﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SearchVOrganization.ascx.vb"
    Inherits="WebForm_ManageVolunteer_SearchVOrganization" %>
<%@ Register Src="~/WebForm/CommonControl/ChangeRecordControl.ascx" TagName="ChangeRecordControl"
    TagPrefix="My" %>
<table>
    <tr>
        <asp:UpdatePanel ID="upOrganizationID" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <td align="right">
                    <asp:Label ID="lblOrganizationID" runat="server" meta:resourcekey="lblOrganizationID"></asp:Label>
                </td>
                <td align="left">
                    <asp:DropDownList ID="ddlOrganizationID" runat="server" AutoPostBack="true">
                    </asp:DropDownList>
                </td>
                <asp:PlaceHolder ID="phVOrganizationID" runat="server" Visible="false">
                    <td align="right">
                        <asp:Label ID="lblVOrganizationID" runat="server" meta:resourcekey="lblVOrganizationID"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="ddlVOrganizationID" runat="server" AutoPostBack="false">
                        </asp:DropDownList>
                    </td>
                </asp:PlaceHolder>
            </ContentTemplate>
        </asp:UpdatePanel>
        <td>
            <asp:Button ID="btnQuery" runat="server" meta:resourcekey="btnQuery" />
        </td>
    </tr>
</table>
<br />
<My:MyGridView ID="gv" runat="server" SkinID="pager" meta:resourcekey="gv" AllowPaging="True"
    AllowHoverSelect="False" DataKeyNames="VOrganizationID" AllowHoverEffect="True"
    DataSourceID="ObjectDataSource1" MySortDirection="Ascending">
    <Columns>
        <asp:TemplateField meta:resourcekey="bfVOrganizationName">
            <edititemtemplate>
                <%#Eval("VOrganizationName") %>
            </edititemtemplate>
            <itemtemplate>
                <asp:LinkButton ID="lknOrganizationName" runat="server" CommandName="Edit" Text='<%#Bind("VOrganizationName") %>'></asp:LinkButton>
            </itemtemplate>
        </asp:TemplateField>
        <asp:TemplateField meta:resourcekey="bfServiceType">
            <edititemtemplate>
                <asp:TextBox ID="txtServiceType" runat="server" Text='<%#Bind("ServiceType") %>'></asp:TextBox>
                <asp:Button ID="btnSave" runat="server" CommandName="Update" meta:resourcekey="btnSave" />
                <asp:Button ID="btnCancel" runat="server" CommandName="Cancel" meta:resourcekey="btnCancel" />
            </edititemtemplate>
            <itemtemplate>
                <%#Eval("ServiceType") %>
            </itemtemplate>
        </asp:TemplateField>
        <asp:TemplateField meta:resourcekey="bfLeaderName">
            <itemtemplate>
                <%#Eval("LeaderName") %>
            </itemtemplate>
        </asp:TemplateField>        
        <asp:BoundField DataField="PersonCount" meta:resourcekey="bfPersonCount" ReadOnly="true" />        
        <asp:TemplateField>
            <itemtemplate>
                <asp:LinkButton ID="lknEdit" CommandName="Select" runat="server" 
                    meta:resourcekey="lknEdit"></asp:LinkButton>
            </itemtemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <itemtemplate>
                <asp:LinkButton ID="lknReleaseAll" CommandName="ReleaseAll" runat="server" 
                    meta:resourcekey="lknReleaseAll"></asp:LinkButton>
                <ajaxToolkit:ConfirmButtonExtender ID="cbReleaseAll" runat="server" TargetControlID="lknReleaseAll"
                     meta:resourcekey="cbReleaseAll">
                </ajaxToolkit:ConfirmButtonExtender>
            </itemtemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <itemtemplate>
                <asp:Button ID="btnLock" runat="server"  CommandName="Lock" meta:resourcekey="btnLock" Visible='<%#Eval("IsLock") %>' />
                <asp:Button ID="btnUnLock" runat="server"  CommandName="UnLock" meta:resourcekey="btnUnLock" Visible='<%#Eval("IsUnLock") %>' />
            </itemtemplate>
        </asp:TemplateField>
        
    </Columns>
</My:MyGridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
    SelectMethod="BLL_Select" TypeName="BLL_SearchVOrganization" UpdateMethod="BLL_Update">
    <SelectParameters>
        <asp:Parameter Name="VOrganizationID" Type="String" />
        <asp:Parameter Name="DirectUOrganizationID" Type="String" />
        
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="ServiceType" Type="String" />
        <asp:Parameter Name="original_VOrganizationID" Type="Int32" />
    </UpdateParameters>
</asp:ObjectDataSource>
<My:ChangeRecordControl ID="ChangeRecordControl1" runat="server" />